<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <link rel="StyleSheet" href="css/mypetstore.css" type="text/css" media="screen"/>
</head>
<body>
    <script type="text/javascript">
        //刷新验证码
        function changeImg(){
            document.getElementById("validateCodeImg").src="helpDrawValidateCode?t=" + Math.random();
        }

        // 获取当前页面的 URL
        const currentURL = window.location.href;
        // 将当前页面的 URL 存储到 Session
        sessionStorage.setItem('redirectURL', currentURL);
    </script>

    <div th:include="common/top :: #Header"></div>

    <div id="Content">
        <div id="Catalog">
            <form action="/login" method="post">
                <p>Please enter your username and password.</p>
<!--                <c:if test="${requestScope.signOnMsg != null}">-->
<!--                    <p> <font color="red">${requestScope.signOnMsg} </font> </p>-->
<!--                </c:if>-->
                    <p  th:text="${loginMsg}"></p>
                <p>
                    Username:<input type="text" name="username" value="j2ee"> <br />
                    Password:<input type="password" name="password" value="123"><br/>
                    Captcha:<input type="text" name="validateCode" style="width:50px">
                    <img alt="看不清？换一张" src="helpDrawValidateCode" id="validateCodeImg" onclick="changeImg()">
<!--                    <c:if test="${sessionScope.account == null}">-->
<!--                        Username:<input type="text" name="username" value="j2ee"> <br />-->
<!--                        Password:<input type="password" name="password" value="123"><br/>-->
<!--                        Captcha:<input type="text" name="validateCode" style="width:50px">-->
<!--                        <img alt="看不清？换一张" src="helpDrawValidateCode" id="validateCodeImg" onclick="changeImg()">-->
<!--                    </c:if>-->
<!--                    <c:if test="${sessionScope.account!= null}">-->
<!--                        Username:<input type="text" name="username" value="${sessionScope.account.username}"><br />-->
<!--                        Password:<input type="password" name="password" value="${sessionScope.account.password}"><br/>-->
<!--                        Captcha:<input type="text" name="validateCode" style="width:50px">-->
<!--                        <img alt="看不清？换一张" src="helpDrawValidateCode" id="validateCodeImg" onclick="changeImg()">-->
<!--                    </c:if>-->

                </p>
                <input type="submit" value="Login">
            </form>
            Need a user name and password?
            <a href="registerForm">Register Now!</a>
        </div>
    </div>


    <div th:include="common/bottom ::#Footer"></div>
</body>
</html>